package com.dao.cook.imp;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import com.dao.cook.CtomorrowmenuDaoY;
import com.po.Dish;
import com.po.TomorrowmenuY;

@Repository
public class CtomorrowmenuDaoImpY implements CtomorrowmenuDaoY {
	@Resource(name = "sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public List<TomorrowmenuY> getTomorrowmenuList() {
		List<TomorrowmenuY> list=sqlSessionTemplate.selectList("getTomorrowmenuListY");
		return list;
	}

	@Override
	public int delTomorrowmenu() {
		int i=sqlSessionTemplate.delete("delTomorrowmenuY");
		return i;
	}

	@Override
	public int addTomorrowmenus(List<Dish> menus) {
		int i=sqlSessionTemplate.insert("addTomorrowmenusY", menus);
		return i;
	}

	@Override
	public TomorrowmenuY getTomorrowmenu(String id) {
		TomorrowmenuY tomorrowmenu=sqlSessionTemplate.selectOne("getTomorrowmenuY", id);
		return tomorrowmenu;
	}

	

}
